-
Notifications
You must be signed in to change notification settings - Fork 1
[feat:extensions] add support to package web-bot-auth #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
01fb400 to
6380ccd
Compare
rgarcia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good feature addition! The overall structure is clean and the UX is thoughtful with helpful next-steps messaging.
Main areas to address:
- JWK vs PEM messaging: Several places in help text, logs, and comments refer to "JWK" but PEM format is also supported. Would be good to make this consistent.
- Error handling: A few places where
os.Staterrors other thanIsNotExistare silently ignored, and some URL update failures are warnings instead of errors. - Stability: Consider pinning the GitHub download to a specific commit to avoid upstream breaking changes.
- Crypto code: The stdlib already has
crypto/x509.MarshalPKCS8PrivateKeyfor Ed25519 - no need to hand-roll ASN.1.
| // Error if no replacements were made | ||
| if modified == original { | ||
| return fmt.Errorf("pattern %q not found in file %s", oldStr, path) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ModifyFile fails with misleading error when replacement equals search
Medium Severity
The ModifyFile function returns a "pattern not found" error when modified == original, but this condition is also true when the search pattern exists but the replacement string is identical to it. If a user passes --url http://localhost:8000 (matching defaultLocalhostURL), all ModifyFile calls in buildWebBotAuthExtension will fail with a misleading error message, even though the pattern was found. The comparison doesn't distinguish between "pattern absent" and "replacement is no-op".
Note
Introduces a streamlined way to prepare the Cloudflare
web-bot-authbrowser extension for Kernel.extensions build-web-bot-authcommand with flags--to,--url,--key(JWK or PEM), and--uploadto optionally upload under a given namepolicy.json, plist,update.xml) using a readableExtensionNamepathprivate_key.pem, and adds.gitignoreto exclude it from uploads.crx,update.xml, MV3 chromium files, policy/) to output directory and prints next stepsWritten by Cursor Bugbot for commit a34ef52. This will update automatically on new commits. Configure here.